/*
 *  Copyright 2023 Collate.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *  http://www.apache.org/licenses/LICENSE-2.0
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

@import (reference) '../../../../styles/variables.less';

.total-data-assets-widget-container {
  display: flex;
  flex-direction: column;
  height: 100%;

  .widget-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
}

.total-data-assets-widget-content {
  .legend-list {
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    gap: @size-sm;
    max-height: 300px;

    .d-flex {
      flex: 0 0 auto;
      width: calc(50% - @size-sm / 2);
    }

    .data-value {
      border-radius: @border-rad-md;
      background-color: @grey-31;
    }
  }

  .donut-chart-wrapper {
    position: relative;
    flex-shrink: 0;
  }

  .donut-center-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
  }

  .date-selector-wrapper {
    .date-selector-container {
      display: flex;
      flex-wrap: wrap;
      gap: @size-xs;
      justify-content: center;
      min-width: 0;
      padding: 0 @padding-sm;
    }

    .date-box {
      border: 1px solid @grey-2;
      background: @grey-29;
      padding: @padding-xs @padding-sm;
      border-radius: @border-rad-sm;
      text-align: center;
      cursor: pointer;
      flex: 1 1 0;
      min-width: 40px;
      max-width: 60px;

      .month {
        color: @grey-32;
      }

      &.selected {
        border: 1px solid @blue-36;
        background: @blue-38;
      }
    }
  }

  .recharts-tooltip-item-name,
  .recharts-tooltip-item-value {
    color: @black;
  }

  .recharts-default-tooltip {
    background-color: @white;
    border-radius: @border-rad-md;
    padding: @padding-sm;
    border: none !important;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
  }

  .recharts-responsive-container {
    svg {
      margin-top: @margin-lg;
    }
  }
}
